package com.ticket.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.ticket.entity.SeatAllocation;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

@Mapper
public interface SeatAllocationMapper extends BaseMapper<SeatAllocation> {
    
    @Select("SELECT MIN(seat_number) FROM seat_allocations WHERE match_id = #{matchId} AND section_id = #{sectionId} AND status = 'AVAILABLE'")
    Integer getNextAvailableSeatNumber(Long matchId, Long sectionId);

    @Select("SELECT capacity FROM venue_sections WHERE id = #{sectionId}")
    Integer getSectionCapacity(Long sectionId);
} 